package com.zxx.pattern.factoryPattern.factoryDelete.abstrct.factory;

import com.zxx.pattern.factoryPattern.factoryDelete.abstrct.color.Color;
import com.zxx.pattern.factoryPattern.factoryDelete.abstrct.shape.Rectangle;
import com.zxx.pattern.factoryPattern.factoryDelete.abstrct.shape.Shape;
import com.zxx.pattern.factoryPattern.factoryDelete.abstrct.shape.Square;

/**
 * @author zxx on 2020/12/29
 */
public class ShapeFactory extends AbstractFactory {

    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        if(shape == null){
            return null;
        }
        if(shape.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle();
        } else if(shape.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }
}
